<div class="table-scroll" *ngIf="data && data.length">
  <div>
    <div class="table-left">
      <table>
        <!--<tr *ngFor="let h of header" [class.hidden]="data && !data[0][h.key]">-->
        <tr *ngFor="let h of header; trackBy: trackByHeader" [class.trActived]="trActived(h)" (click)="toggleType(h)">
          <td [ngClass]="{cursorType: h.clickEmitter, subTitle: h.key === classify && !titleAtRight}">
            {{
              h.key !== classify || !titleAtRight
                ? h.label
                : ''
            }}
          </td>
        </tr>
      </table>
    </div>
    <div class="table-right">
      <table>
        <!--<tr *ngFor="let h of header" [class.hidden]="data && !data[0][h.key]">-->
        <tr *ngFor="let h of header; trackBy: trackByHeader" [class.trActived]="trActived(h)" (click)="toggleType(h)">
          <td *ngFor="let d of data; let i = index; trackBy: trackByItem"
            [attr.colspan]="h.key === classify && (i === 0) ? data.length : ''" 
            [ngClass]="{
              hidden: h.key === classify && (i !== 0),
              typeHeader: h.key === classify && (i === 0),
              cursorType: h.clickEmitter,
              tdActived: tdActived(h, d[h.key])
            }"
            (click)="toggleTime(h, d, i)"
            >
            {{
              h.key === classify && (i === 0) > 0
                ? titleAtRight ? h.label : ''
                : h.format ? (d[h.key] || '--' | optimizeUnitF10) : (d[h.key] || '--')
            }}
          </td>
        </tr>
      </table>
    </div>
  </div>
</div>
<div class='tipInfo' *ngIf="!(data && data.length)">
  <h5>查不到相关数据！</h5>
</div>